package O4_Insertion_Sort;

import util.SortTestHelper;

import java.util.Arrays;

/**
 * Created by Choisaaaa on 2018/6/19.
 * 比较SelectionSort和InsertionSort两种排序算法的性能效率
 */

public class Main {
    public static void main(String[] args) {
        int N = 20000;
        System.out.println("Test for random array, size = " + N + " , random range [0, " + N + "]");

        Integer[] arr1 = SortTestHelper.generateRandomArray(N, 0, N);
        Integer[] arr2 = Arrays.copyOf(arr1, arr1.length);

        SortTestHelper.testSort("O3_Selection_Sort.SelectionSort", arr1);
        SortTestHelper.testSort("O4_Insertion_Sort.InsertionSort", arr2);
    }
}
